<%@ page import="zjq.day0109.travelTrip.dao.TravellerDao" %>
<%@ page import="zjq.day0109.travelTrip.dao.impl.TravellerDaoImpl" %>
<%@ page import="zjq.day0109.travelTrip.entity.Traveller" %>
<%@ page import="java.util.List" %>
<%@ page import="zjq.day0109.travelTrip.test.Test" %><%--
  Created by IntelliJ IDEA.
  User: lenovo
  Date: 2023/1/9
  Time: 19:42
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <title>青游旅行社服务平台</title>
    <link rel="stylesheet" type="text/css" href="../../../css/zjq/day0110/service.css"/>
    <script src="../../../js/zjq/day0109/jquery-3.6.3.js" type="text/javascript" charset="utf-8"></script>
    <script src="../../../js/zjq/day0110/service.js" type="text/javascript" charset="utf-8"></script>
    <%
        //jsp组成部分：jsp小脚本  内置对象（9个）  jsp指定
        /* 在jsp页面中获取后端java程序，进行数据交互 */
        //1.使用多态体现，创建实例化UserDao数据访问层
        TravellerDao travellerDao = new TravellerDaoImpl();

        List<Traveller> travellerList = travellerDao.queryAllUser();
    %>
</head>
<body>
<div id="container">
    <header>
        <h1 style="text-align: center;">青游旅行社服务平台</h1>
    </header>
    <div id="main_body">
        <div id="main_center">
            <div id="search">
                <form method="get" action="serviceController.jsp">
                <button name="btnSearch" onclick="location.href='../../../jsp/zjq/day0110/add.jsp'">添加</button>
                </form>
            </div>
            <table>
                <thead>
                <tr>
                    <th>旅游路线名称</th>
                    <th>类型</th>
                    <th>价格(元)</th>
                    <th>咨询电话</th>
                    <th>咨询人</th>
                    <th>创建日期</th>
                    <th>操作</th>
                </tr>
                <%
                    for (int i = 0; i < travellerList.size() ; i++) {

                %>
                <tr>
                    <td><%=travellerList.get(i).getName()%></td>
                    <td><%=travellerList.get(i).getType()%></td>
                    <td><%=travellerList.get(i).getPrice()%></td>
                    <td><%=travellerList.get(i).getPhoneUser()%></td>
                    <td><%=travellerList.get(i).getPhone()%></td>
                    <td></td>
                </tr>
                <% }%>
                </thead>
                <tbody>

                </tbody>
            </table>
            </br></br></br></br>
            <table id="ta" style="display: none;">
                <thead class="th" onclick="th">
                <tr>
                    <th>旅游地点</th>
                    <th>时长</th>
                    <th>景点</th>
                </tr>


                <tr>
                    <td>大熊猫繁育基地</td>
                    <td>1天</td>
                    <td>可以看到刚出生不久的小熊猫哦</td>
                </tr>
                <tr>
                    <td>武侯祠</td>
                    <td>0.5天</td>
                    <td>三国时期蜀国丞相诸葛亮的祠堂</td>
                </tr>
                <tr>
                    <td>宽窄巷子</td>
                    <td>0.5天</td>
                    <td>一个有着老脸庞的怀旧地带</td>
                </tr>
                </thead>
            </table>
        </div>
    </div>
</div>
</body>
</html>
